home *** CD-ROM | disk | FTP | other *** search
/ Windows Expert / Windows Expert.iso / windownt / uupc11yb.zip / SU.BAT < prev    next >
DOS Batch File  |  1992-11-08  |  4KB  |  72 lines

  1. @echo off
  2. REM *------------------------------------------------------------------*
  3. REM *   Program:        su.bat          03 Nov 1990                    *
  4. REM *   Author:         Andrew H. Derbyshire                           *
  5. REM *   Address:        help@kendra.kew.com                            *
  6. REM *   Function:       Demonstration of multiple user support         *
  7. REM *                   with UUPC/extended                             *
  8. REM *------------------------------------------------------------------*
  9. REM *  This command file provides a simple example of changing the *
  10. REM *  active user id (the user id used when sending mail) in      *
  11. REM *  UUPC/extended.  It assumes:                                 *
  12. REM *                                                              *
  13. REM *  1) The configuration directory is C:\LIB\UUPC,              *
  14. REM *                                                              *
  15. REM *  2) That each user has a PERSONAL.RC file under under his    *
  16. REM *     under own name in the configuration directory.           *
  17. REM *                                                              *
  18. REM *  3) The MS-DOS environment has enough space free to save an  *
  19. REM *     extra copy of the DOS prompt and the current UUPCUSRC    *
  20. REM *     variable.                                                *
  21. REM *                                                              *
  22. REM *  4) A copy of COMMAND.COM can be invoked via the COMSPEC     *
  23. REM *     variable.                                                *
  24. REM *--------------------------------------------------------------*
  25. REM *       If the user didn't invoke us properly, give help       *
  26. REM *--------------------------------------------------------------*
  27. if not "%1" == ""   goto ok
  28. echo Syntax:   %0 userid command
  29. echo The command is optional; if not specified, a sub-shell will be
  30. echo invoked.  An example:
  31. echo           %0 postmast mail
  32. goto quit
  33. REM *--------------------------------------------------------------*
  34. REM *                Save the current environment                  *
  35. REM *--------------------------------------------------------------*
  36. :ok
  37. SET UUPCPRMPT=%prompt%
  38. SET UUPCUSRRX=%UUPCUSRRC%
  39. REM *------------------------------------------------------------------*
  40. REM *   Change the following line if your UUPC PERSONAL.RC files       *
  41. REM *                    aren't in C:\uupc                         *
  42. REM *------------------------------------------------------------------*
  43. SET UUPCUSRRC=\uupc\%1.rc
  44. REM *------------------------------------------------------------------*
  45. REM *                    Verify the file exists                        *
  46. REM *------------------------------------------------------------------*
  47. if not exist %UUPCUSRRC% goto error
  48. PROMPT Enter EXIT to logout from %1$_%UUPCPRMPT%
  49. REM *------------------------------------------------------------------*
  50. REM *            Run a sub-shell with the new variables                *
  51. REM *------------------------------------------------------------------*
  52. if "%2" == "" goto shell
  53. %2 %3 %4 %5 %6 %7 %8 %9
  54. goto exit
  55. :shell
  56. %comspec%
  57. goto exit
  58. REM *------------------------------------------------------------------*
  59. REM *             Come here to issue an error message                  *
  60. REM *------------------------------------------------------------------*
  61. :error
  62. echo %UUPCUSRRC% doesn't exist!  Please verify %1 is a valid user.
  63. REM *------------------------------------------------------------------*
  64. REM *                   Reset variables and exit                       *
  65. REM *------------------------------------------------------------------*
  66. :exit
  67. PROMPT %UUPCPRMPT%
  68. SET UUPCUSRRC=%UUPCUSRRX%
  69. SET UUPCPRMPT=
  70. SET UUPCUSRRX=
  71. :quit
  72.